package com.shenmazong.servereduschool.controller;


import com.shenmazong.servereduschool.entity.TbCollage;
import com.shenmazong.servereduschool.service.ITbCollageService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.BatchChooseIdVo;
import com.shenmazong.vo.ListParamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 学院表——suliven 前端控制器
 * </p>
 *
 * @author 关好帅
 * @since 2021-09-21
 */
@RestController
@RequestMapping("/collage")
public class TbCollageController {
    @Autowired
    private ITbCollageService collageService;
    /**
     * @description 学院注册
     * @author GuanJiaHe
     * @date 2021/9/21 19:01
     * @version 1.0
     */
    @PostMapping("registerCollage")
    public ResultResponse registerCollage(@RequestBody TbCollage collage){
        return collageService.registerCollage(collage);
    }

    /**
     * @description 删除学院
     * @author GuanJiaHe
     * @date 2021/9/21 19:01
     * @version 1.0
     */
    @DeleteMapping("deleteCollage")
    public ResultResponse deleteCollage(@RequestBody BatchChooseIdVo idVo){
        return collageService.deleteCollage(idVo);
    }

    /**
     * @description 更新学院信息
     * @author GuanJiaHe
     * @date 2021/9/21 19:01
     * @version 1.0
     */
    @PostMapping("updateCollage")
    public ResultResponse updateCollage(@RequestBody TbCollage collage){
        return collageService.updateCollage(collage);
    }

    /**
     * @description 查询所有学院
     * @author GuanJiaHe
     * @date 2021/9/21 19:01
     * @version 1.0
     */
    @PostMapping("queryCollage")
    public ResultResponse queryCollage(@RequestBody ListParamVo paramVo){
        return collageService.queryCollage(paramVo);
    }


}
